// Dash to Dock

// Scrollview style
.bottom #dashtodockDashScrollview,
.top #dashtodockDashScrollview {
  -st-hfade-offset: 24px;
}

.left #dashtodockDashScrollview,
.right #dashtodockDashScrollview {
  -st-vfade-offset: 24px;
}

#dashtodockContainer {
  background-color: transparent;

  .number-overlay {
    color: $panel-text;
    background-color: rgba(black, 0.75);
    text-align: center;
  }

  .notification-badge {
    color: on($primary);
    background-color: $primary;
    box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.25);
    border-radius: $circular_radius;
    margin: 2px;
    padding: 0.2em 0.6em;
    font-weight: bold;
    text-align: center;
  }

  @each $_pos, $b_pos in (top, bottom),
                         (bottom, top),
                         (left, right),
                         (right, left) {
    &.#{$_pos} #dash .dash-background {
      border-radius: $dash_border_radius !important;
    }

    &.#{$_pos}.shrink {
      #dash .dash-background {
        border-radius: $modal_radius + $base_margin !important;
      }
    }

    &.#{$_pos}.straight-corner,
    &.#{$_pos}.shrink.straight-corner,
    &.#{$_pos}.extended,
    &.#{$_pos}.shrink.extended {
      #dash {
        margin: 0 !important;
        margin-top: 0 !important;
        padding: 0 !important;

        .dash-background {
          margin: 0 !important;
          margin-bottom: 0 !important;
          border-radius: 0 !important;
        }

        .show-apps,
        .overview-tile {
          margin: 0 !important;
        }
      }
    }
  }

  &.extended,
  &.straight-corner {
    .dash-background {
      border-radius: 0 !important;
    }
  }

  #dash,
  &:overview #dash {
    background: transparent;
  }

  &.left,
  &.right {
    #dash {
      margin-top: 0 !important;
      padding: $dash_padding !important;

      #dashtodockDashContainer {
        padding: $dash_padding - $dash_spacing 0 !important;
      }
    }

    .show-apps,
    .overview-tile {
      padding: $dash_spacing $base_padding !important;
    }

    .dash-background {
      margin-bottom: 0 !important;
    }

    &.shrink {
      #dash {
        #dashtodockDashContainer {
          padding: $base_margin 0 !important;
        }
      }

      .dash-background {
        padding: $base_margin !important;
      }

      .show-apps,
      .overview-tile {
        margin: 0 !important;
        padding: 0 !important;
      }
    }

    &.extended,
    &.straight-corner {
      #dash {
        #dashtodockDashContainer {
          padding: 0 !important;

          #dashtodockDashScrollview:first-child {
            padding-top: 0 !important;
          }

          #dashtodockDashScrollview:last-child {
            padding-bottom: 0 !important;
          }

          & > :first-child {
            .show-apps {
              padding-bottom: $base_padding !important;
            }
          }

          & > :last-child {
            .show-apps {
              padding-bottom: $dash_padding + $base_padding * 2 !important;
            }
          }
        }
      }

      &.shrink {
        #dash {
          #dashtodockDashContainer {
            & > :last-child {
              .show-apps {
                padding-bottom: 0 !important;
              }
            }
          }
        }

        .dash-background {
          padding: 0 !important;
        }
  
        .show-apps,
        .overview-tile {
          margin: 0 !important;
          padding: 0 !important;
        }
      }

      .overview-tile {
        padding: $dash_spacing $dash_padding !important;
      }

      .show-apps {
        padding: $dash_spacing $dash_padding $dash_padding * 2 !important;
      }
    }
  }

  &.top,
  &.bottom {
    .dash-background {
      padding: $dash_padding ($dash_padding - $dash_spacing) !important;;
    }

    .show-apps,
    .overview-tile {
      margin: 0 $dash_spacing !important;
      padding-bottom: $dash_edge_offset !important;

      .overview-icon {
        padding: $base_padding !important;
        spacing: $base_padding !important;
      }
    }

    &.shrink {
      .dash-background {
        padding: $base_margin $base_margin / 2 !important;
      }

      .show-apps,
      .overview-tile {
        margin: 0 !important;
        padding: 0 $base_margin / 2 $dash_padding !important;
      }
    }

    &.extended,
    &.straight-corner {
      #dash {
        #dashtodockDashContainer {
          padding: 0 !important;

          #dashtodockDashScrollview:first-child {
            padding-left: 0 !important;
          }

          #dashtodockDashScrollview:last-child {
            padding-right: 0 !important;
          }

          & > :first-child {
            .show-apps {
              padding-left: 0 !important;
            }
          }

          & > :last-child {
            .show-apps {
              padding-right: $dash_padding + $base_padding !important;
            }
          }
        }
      }

      &.shrink {
        .dash-background {
          padding: 0 !important;
        }
  
        .show-apps,
        .overview-tile {
          margin: 0 !important;
          padding: 0 !important;
        }

        #dash {
          #dashtodockDashContainer {
            & > :last-child {
              .show-apps {
                padding-right: 0 !important;
              }
            }
          }
        }
      }

      .dash-separator {
        margin: 0 ($dash_spacing + ($dash_padding / 2)) !important;
      }

      .show-apps,
      .overview-tile {
        padding: $dash_padding $dash_spacing !important;
      }
    }
  }

  #dash {
    .dash-background {
      background-color: $panel;
    }

    .overview-tile,
    .show-apps {
      .overview-icon {
        color: $panel-text;
      }

      &:focus .overview-icon { background-color: $panel-fill; }
      &:hover .overview-icon { background-color: $panel-divider; }
      &:active .overview-icon { background-color: $panel-track; }
      &:checked .overview-icon { background-color: $panel-divider; }
    }

    .app-grid-running-dot {
      margin: 0 !important;
      offset-y: 0 !important;
      background-color: $panel-text-disabled !important;
    }

    StWidget.focused .app-grid-running-dot {
      background-color: $applet-primary !important;
    }
  }

  &:overview #dash { // overview-mode #1
    background: none;

    .overview-tile,
    .show-apps {
      .overview-icon {
        color: on($osd);
      }

      &:focus .overview-icon { background-color: on($osd, fill); }
      &:hover .overview-icon { background-color: on($osd, divider); }
      &:active .overview-icon { background-color: on($osd, track); }
      &:checked .overview-icon { background-color: on($osd, divider); }
    }

    .dash-background {
      background-color: on($osd, divider) !important;
    }

    .app-grid-running-dot {
      background-color: on($osd, disabled) !important;
    }

    StWidget.focused .app-grid-running-dot {
      background-color: $inverse-indicator !important;
    }
  }

  &.opaque #dash .dash-background { // solid-mode
    background-color: $panel;
  }

  &.transparent #dash .dash-background { // translucent-mode
    background-color: rgba($panel, 0.35); // does not work
  }

  &.opaque:overview,
  &.transparent:overview { // overview-mode #2
    #dash .dash-background {
      background-color: transparent !important;
      box-shadow: none !important;
    }
  }

  &.extended:overview, // overview-mode #3
  &.opaque.extended:overview,
  &.transparent.extended:overview {
    #dash .dash-background {
      background-color: $panel;
    }
  }

  &.running-dots,
  &.dashtodock {
    .dash-item-container > StButton {
      transition-duration: 250ms;
      background-size: contain;
    }
  }

  &.shrink,
  &.dashtodock {
    .dash-item-container > StButton {
       padding: 1px 2px;
    }
  }

  &.extended,
  &.extended:overview {
    .overview-tile,
    .show-apps {
      .overview-icon {
        border-radius: $base_radius;
      }
    }
  }

  .metro .overview-icon {
    border-radius: 0;
  }
}

.dashtodock-app-well-preview-menu-item {
  padding: 1em 1em 0.5em 1em;
}

#dashtodockPreviewSeparator.popup-separator-menu-item-horizontal {
  width: 1px;
  height: auto;
  border-right-width: 1px;
  margin: 32px 0;
}

.dash-label.bottom {
  margin-bottom: $dash_padding !important;
}
